/**
 * 接口管理
 */
import request from './../utils/request'
export default {
    //登陆请求接口
    login(params) {
        return request({
            url: '/users/login',
            method: 'post',
            data: params,
            mock:false
        })
    },
    //获取菜单列表
    getMenuList(params) {
        return request({
            url: '/menu/list',
            method: 'get',
            data: params,
            mock: false
        })
    },
    //审批查询
    getLeaveQueryList(params) {
        return request({
            url: '/leaves/queryist',
            method: 'get',
            data: params,
            mock: false
        })
    },
    //获取用户列表
    getUserList(params) {
        return request({
            url: '/users/list',
            method: 'get',
            data: params,
            mock: false
        })
    },
    //对用户删除操作
    userDel(params) {
        return request({
            url: '/users/delete',
            method: 'post',
            data: params,
            mock: false
        })
    },
    // 获取所有角色列表
    getRoleAllList() {
        return request({
            url: '/roles/allList',
            method: 'get',
            data: {},
            mock: false
        })
    },
    //获取部门列表
    getDeptList(params) {
        return request({
            url: '/dept/list',
            method: 'get',
            data: params,
            mock: false
        })
    },
    //用户信息更改操作
    userSubmit(params) {
        return request({
            url: '/users/operate',
            method: 'post',
            data: params,
            mock: false
        })
    },

    //获取用户角色名
    getRoleName(params) {
        return request({
            url: '/roles/getName',
            method: 'post',
            data: params,
            mock: false
        })
    },
    //获取用户部门名
    getDeptName(params) {
        return request({
            url: '/dept/getName',
            method: 'post',
            data: params,
            mock: false
        })
    },
    //用户信息更改操作
    getApproveUser(params) {
        return request({
            url: '/approve/user',
            method: 'get',
            data: params,
            mock: false
        })
    },
    // 菜单更改操作
    menuSubmit(params) {
        return request({
            url: '/menu/operate',
            method: 'post',
            data: params,
            mock: false
        })
    },
    // 获取角色列表
    getRoleList(params) {
        return request({
            url: '/roles/list',
            method: 'get',
            data: params,
            mock: false
        })
    },
    //角色更改操作
    roleOperate(params) {
        return request({
            url: '/roles/operate',
            method: 'post',
            data: params,
            mock: false
        })
    },
    //更新角色权限操作
    updatePermission(params) {
        return request({
            url: '/roles/update/permission',
            method: 'post',
            data: params,
            mock: false
        })
    },
    // 获取所有用户列表操作
    getAllUserList(params) {
        return request({
            url: '/users/list',
            method: 'get',
            data: params,
            mock: false
        })
    },
    //删除操作
    deptOperate(params) {
        return request({
            url: '/dept/operate',
            method: 'post',
            data: params,
            mock: false
        })
    },
    // 获取用户消息通知操作
    getApproveList(loginUserId) {
        return request({
            url: '/approve/list',
            method: 'get',
            data: loginUserId,
            mock: false
        })
    },
    // 获取未读消息通知操作
    getApproveNoReadList(params) {
        return request({
            url: '/approve/count',
            method: 'get',
            data: params,
            mock: false
        })
    },
    // 更新消息操作
    updateApprove(params) {
        return request({
            url: '/approve/updateRead',
            method: 'post',
            data: params,
            mock: false
        })
    },
    // 删除消息操作
    deleteApprove(params) {
        return request({
            url: '/approve/deleteOne',
            method: 'post',
            data: params,
            mock: false
        })
    },
    // 一键已读接口
    afterAllRead(params) {
        return request({
            url: '/approve/allRead',
            method: 'post',
            data: params,
            mock: false
        })
    },
    // 一键删除接口
    deleteAllApprove(params) {
        return request({
            url: '/approve/deleteAll',
            method: 'post',
            data: params,
            mock: false
        })
    },
    //修改密码
    updatePassword(params){
        return request({
            url: '/users/updatePassword',
            method: 'post',
            data: params,
            mock: false
        })
    },
    //获取审批列表
    getLeavesList(params){
        return request({
            url: '/leaves/list',
            method: 'get',
            data: params,
            mock: false
        })
    },
    //获取审批列表
    addLeaves(params){
        return request({
            url: '/leaves/addLeaves',
            method: 'post',
            data: params,
            mock: false
        })
    }
}

